#ifndef __BSTREE_H
#define __BSTREE_H

typedef float ElementType;
struct node;
typedef struct node Node;
typedef struct node * PtrToNode;
typedef struct node * Tree;

#define ORDER_PRE 1
#define ORDER_MID 2
#define ORDER_POST 3


PtrToNode newNode(ElementType x);
ElementType retrieve(PtrToNode node);
int compare(ElementType x, ElementType y);// if 1:x>y, 0 x=y, -1 x<y
void printNode(PtrToNode aNode);
Tree insert(Tree t, ElementType x);
void printTree(Tree t, int order); // 1:preorder, 2:midorder, 3:postorder

// Tree makeEmpty(Tree t);
// PtrToNode find(Tree t, ElementType x);
PtrToNode findMin(Tree t);
PtrToNode findMax(Tree t);
Tree deleteNode(Tree t, ElementType x);
// void* handleNode(PtrToNode node);
// void traves(Tree t, void* (*handleNode)(PtrToNode));

#endif